//
// RS Game Framework
// Copyright © 2010 Jedd Haberstro
// jhaberstro@gmail.com
// 
// $Id:
//

#ifndef RS_GRAPHICS_RESOURCEDESCRIPTION_HPP
#define RS_GRAPHICS_RESOURCEDESCRIPTION_HPP

#include "rs/graphics/GraphicsForwards.hpp"
#include "rs/Portability.hpp"
#include "rs/reflection/Reflection.hpp"

namespace rs
{
    namespace graphics
    {
        class ResourceDescription
        {
            RS_DECLARE_POLYMORPHIC_REFLECTION()
            
        public:
            
            ResourceDescription(ResourceType::Enum type, ResourceAccess::Enum access, ResourceUsage::Enum usage);
            
            ResourceAccess::Enum GetAccess() const;
            
            ResourceType::Enum GetType() const;
            
            ResourceUsage::Enum GetUsage() const;
            
            void SetAccess(ResourceAccess::Enum access);
            
            void SetType(ResourceType::Enum type);
            
            void SetUsage(ResourceUsage::Enum usage);
            
        protected:
            
            UInt8 type_;
            UInt8 access_;
            UInt8 usage_;
        };
        
                
        inline ResourceDescription::ResourceDescription(ResourceType::Enum type, ResourceAccess::Enum access, ResourceUsage::Enum usage)
        : type_(static_cast< UInt8 >(type)),
          access_(static_cast< UInt8 >(access)),
          usage_(static_cast< UInt8 >(usage)) {
        }
        
        inline ResourceAccess::Enum ResourceDescription::GetAccess() const {
            return static_cast< ResourceAccess::Enum >(access_);
        }
        
        inline ResourceType::Enum ResourceDescription::GetType() const {
            return static_cast< ResourceType::Enum >(type_);
        }
        
        inline ResourceUsage::Enum ResourceDescription::GetUsage() const {
            return static_cast< ResourceUsage::Enum >(usage_);
        }
        
        inline void ResourceDescription::SetAccess(ResourceAccess::Enum access) {
            access_ = static_cast< UInt8 >(access);
        }
        
        inline void ResourceDescription::SetType(ResourceType::Enum type) {
            type_ = static_cast< UInt8 >(type);
        }
        
        inline void ResourceDescription::SetUsage(ResourceUsage::Enum usage) {
            usage_ = static_cast< UInt8 >(usage);
        }
    }
}

#endif // RS_GRAPHICS_RESOURCEDESCRIPTION_HPP